module.exports = function createRoute(name, cnname) {
  cnname = cnname ? `(${cnname})` : '';
  return `
const ${name} = require("../../src/${name}/${name}Service");
module.exports = {
  path: "/${name}",
  name: "${name}${cnname}模块",
  children: [
    {
      path: "/add",
      name: "添加",
      service: ${name}["add"],
      params: {
        name: "${name}"
      }
    },
     {
       path: "/list",
       name: "${cnname}列表",
       service: ${name}["all"],
       params: {
        //  currPage: "当前页",
        //  pageSize: "每页条数",
       }
     },
    //  {
    //    path: "/all",
    //    name: "${cnname}列表",
    //    service: ${name}["all"], 
    //  },
    {
      path: "/find",
      name: "根据条件查找",
      service: ${name}["find"],
      params: {
        
      }
    },
       {
       path: "/detail",
       name: "详情",
       service: ${name}["detail"],
       params: {
         ${name}Id: "${name}Id"
       }
     },
     {
       path: "/edit",
       name: "修改",
       service: ${name}["edit"],
       params: {
         ${name}Id: "${name}Id"
       }
     },
     {
       path: "/del",
       name: "删除",
       service: ${name}["del"],
       params: {
         ${name}Id: "${name}Id"
       }
     }
  ]
};
`;
};
